package com.jeff.android.lab.database;

import com.jeff.android.lab.BaseRecyclerViewFragment;
import com.jeff.android.lab.database.greendao.GreenDaoFragment;
import com.jeff.android.lab.database.ormlite.OrmLiteFragment;
import com.jeff.android.lab.database.room.RoomFragment;
import com.jeff.android.lab.util.RouterUtil;

import java.util.ArrayList;
import java.util.List;

public class DatabaseMainFragment extends BaseRecyclerViewFragment {

    @Override
    protected List<String> getData() {
        return new ArrayList<String>() {
            {
                add("OrmLite");
                add("GreenDao");
                add("Room");
            }
        };
    }

    @Override
    protected void launch(String widget) {
        if ("OrmLite".equals(widget)) {
            RouterUtil.launchFragmentActivity(getContext(), OrmLiteFragment.class);
        } else if ("GreenDao".equals(widget)) {
            RouterUtil.launchFragmentActivity(getContext(), GreenDaoFragment.class);
        } else if ("Room".equals(widget)) {
            RouterUtil.launchFragmentActivity(getContext(), RoomFragment.class);
        }
    }

}